ran=`grep "Ran [0-9]\+" /usr1/EcmaCI/shell/262Test/summary_ts2abc_c_release.txt | awk -F' ' '{print $2}'`
echo $ran
sed -i "s#ts2abc_c_release_Ran: 0#Ran: $ran#" /usr1/EcmaCI/shell/262Test/build_summary_table.wip 

passed=`grep "[0-9]\+ passed" /usr1/EcmaCI/shell/262Test/summary_ts2abc_c_release.txt | awk -F' ' '{print $1}'`
echo $passed
sed -i "s#ts2abc_c_release_Passed: 0#Passed: $passed#" /usr1/EcmaCI/shell/262Test/build_summary_table.wip

failed=`grep "[0-9]\+ failed" /usr1/EcmaCI/shell/262Test/summary_ts2abc_c_release.txt | awk -F' ' '{print $1}'`
echo $failed
sed -i "s#ts2abc_c_release_Failed: 0#Failed: $failed#" /usr1/EcmaCI/shell/262Test/build_summary_table.wip

##############################################################################################
ran=`grep "Ran [0-9]\+" /usr1/EcmaCI/shell/262Test/summary_ts2abc_c_debug.txt | awk -F' ' '{print $2}'`
echo $ran
sed -i "s#ts2abc_c_debug_Ran: 0#Ran: $ran#" /usr1/EcmaCI/shell/262Test/build_summary_table.wip 

passed=`grep "[0-9]\+ passed" /usr1/EcmaCI/shell/262Test/summary_ts2abc_c_debug.txt | awk -F' ' '{print $1}'`
echo $passed
sed -i "s#ts2abc_c_debug_Passed: 0#Passed: $passed#" /usr1/EcmaCI/shell/262Test/build_summary_table.wip

failed=`grep "[0-9]\+ failed" /usr1/EcmaCI/shell/262Test/summary_ts2abc_c_debug.txt | awk -F' ' '{print $1}'`
echo $failed
sed -i "s#ts2abc_c_debug_Failed: 0#Failed: $failed#" /usr1/EcmaCI/shell/262Test/build_summary_table.wip

#############################################################################################
ran=`grep "Ran [0-9]\+" /usr1/EcmaCI/shell/262Test/summary_es2panda_c_debug.txt | awk -F' ' '{print $2}'`
echo $ran
sed -i "s#es2panda_c_debug_Ran: 0#Ran: $ran#" /usr1/EcmaCI/shell/262Test/build_summary_table.wip 

passed=`grep "[0-9]\+ passed" /usr1/EcmaCI/shell/262Test/summary_es2panda_c_debug.txt | awk -F' ' '{print $1}'`
echo $passed
sed -i "s#es2panda_c_debug_Passed: 0#Passed: $passed#" /usr1/EcmaCI/shell/262Test/build_summary_table.wip

failed=`grep "[0-9]\+ failed" /usr1/EcmaCI/shell/262Test/summary_es2panda_c_debug.txt | awk -F' ' '{print $1}'`
echo $failed
sed -i "s#es2panda_c_debug_Failed: 0#Failed: $failed#" /usr1/EcmaCI/shell/262Test/build_summary_table.wip

#############################################################################################
ran=`grep "Ran [0-9]\+" /usr1/EcmaCI/shell/262Test/summary_ts2abc_asm_release.txt | awk -F' ' '{print $2}'`
echo $ran
sed -i "s#ts2abc_asm_release_Ran: 0#Ran: $ran#" /usr1/EcmaCI/shell/262Test/build_summary_table.wip 

passed=`grep "[0-9]\+ passed" /usr1/EcmaCI/shell/262Test/summary_ts2abc_asm_release.txt | awk -F' ' '{print $1}'`
echo $passed
sed -i "s#ts2abc_asm_release_Passed: 0#Passed: $passed#" /usr1/EcmaCI/shell/262Test/build_summary_table.wip

failed=`grep "[0-9]\+ failed" /usr1/EcmaCI/shell/262Test/summary_ts2abc_asm_release.txt | awk -F' ' '{print $1}'`
echo $failed
sed -i "s#ts2abc_asm_release_Failed: 0#Failed: $failed#" /usr1/EcmaCI/shell/262Test/build_summary_table.wip

#############################################################################################
ran=`grep "Ran [0-9]\+" /usr1/EcmaCI/shell/262Test/summary_ts2abc_asm_debug.txt | awk -F' ' '{print $2}'`
echo $ran
sed -i "s#ts2abc_asm_debug_Ran: 0#Ran: $ran#" /usr1/EcmaCI/shell/262Test/build_summary_table.wip 

passed=`grep "[0-9]\+ passed" /usr1/EcmaCI/shell/262Test/summary_ts2abc_asm_debug.txt | awk -F' ' '{print $1}'`
echo $passed
sed -i "s#ts2abc_asm_debug_Passed: 0#Passed: $passed#" /usr1/EcmaCI/shell/262Test/build_summary_table.wip

failed=`grep "[0-9]\+ failed" /usr1/EcmaCI/shell/262Test/summary_ts2abc_asm_debug.txt | awk -F' ' '{print $1}'`
echo $failed
sed -i "s#ts2abc_asm_debug_Failed: 0#Failed: $failed#" /usr1/EcmaCI/shell/262Test/build_summary_table.wip

#############################################################################################

ran=`grep "Ran [0-9]\+" /usr1/EcmaCI/shell/262Test/summary_es2panda_asm_debug.txt | awk -F' ' '{print $2}'`
echo $ran
sed -i "s#es2panda_asm_debug_Ran: 0#Ran: $ran#" /usr1/EcmaCI/shell/262Test/build_summary_table.wip 

passed=`grep "[0-9]\+ passed" /usr1/EcmaCI/shell/262Test/summary_es2panda_asm_debug.txt | awk -F' ' '{print $1}'`
echo $passed
sed -i "s#es2panda_asm_debug_Passed: 0#Passed: $passed#" /usr1/EcmaCI/shell/262Test/build_summary_table.wip

failed=`grep "[0-9]\+ failed" /usr1/EcmaCI/shell/262Test/summary_es2panda_asm_debug.txt | awk -F' ' '{print $1}'`
echo $failed
sed -i "s#es2panda_asm_debug_Failed: 0#Failed: $failed#" /usr1/EcmaCI/shell/262Test/build_summary_table.wip
#############################################################################################

function get_5000class_result_string()
{
    ret=$(grep -i "Segmentation fault" $1)
    if [ -n "$ret" ]; then
        result="$2: Segmentation fault"
    else
        result=$(cat $1)
    fi
    
    echo $result
}

build_5000class=`get_5000class_result_string /usr1/EcmaCI/shell/262Test/5000class.txt import5000.js`
sed -i "s#5000classes_time#$build_5000class#" /usr1/EcmaCI/shell/262Test/build_summary_table.wip

build_5000class_new=`get_5000class_result_string /usr1/EcmaCI/shell/262Test/5000class_new.txt import5000_new.js`
sed -i "s#5000classes_new_time#$build_5000class_new#" /usr1/EcmaCI/shell/262Test/build_summary_table.wip
##############################################################################################

#sed -i 's#$#<\/br>#g' /usr1/EcmaCI/shell/262Test/benchmark.txt
#benchmark_scores=`cat /usr1/EcmaCI/shell/262Test/benchmark.txt`
#echo "$benchmark_scores" >> /usr1/EcmaCI/shell/262Test/build_summary_table.wip
/usr1/EcmaCI/shell/262Test/build_benchmark.sh
